package edu.ccut.saturn.studio.wfg.wfgmodel;

import org.w3c.dom.Document;
import org.w3c.dom.Node;

import edu.ccut.saturn.studio.core.util.xml.SaturnW3CUtil;
import edu.ccut.saturn.studio.wfg.utils.RunTime;

public class ExtendAttributeForLogicKey implements SaturnAttribute {

	private String id = "1";
	
	private String parameter = "";
	
	public ExtendAttributeForLogicKey(){
		
	}
	
	public ExtendAttributeForLogicKey(ExtendAttributeForLogicKey extendAttributeForLogicKey){
		this.id = extendAttributeForLogicKey.id;
		this.parameter = extendAttributeForLogicKey.parameter;
	}
	
	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getParameter() {
		return parameter;
	}

	public void setParameter(String parameter) {
		this.parameter = parameter;
	}

	public Node creatNode(Document document, String NodeName){
		Node dataNode = document.createElement(SaturnName.KEY_NODE_NAME_PARAMETER);
		SaturnW3CUtil.createAttribute(dataNode, SaturnName.KEY_NODE_NAME_ID,RunTime.getValue(this, SaturnName.METHOD_GETID));
		dataNode.appendChild(document.createTextNode(RunTime.getValue(this, SaturnName.METHOD_GETPARAMETER)));
		return dataNode;
	}
}
